home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
TPUG - Toronto PET Users Group
/
TPUG Users Group CD
/
TPUG Users Group CD.iso
/
COMAL
/
A-COMAL Series
/
(k)aad.d64
/
proc.convert1
< prev
next >
Wrap
Text File
|
2007-02-28
|
494b
|
18 lines
9000 //
9010 PROC CONVERT(NUMBER,REF BASE#,REF RES$) CLOSED
9020 IF NUMBER<>0 THEN
9030 POWER:=INT(LOG(NUMBER)/LOG(BASE#))
9040 FOR COUNT:=POWER TO 0 STEP -1 DO
9050 DIGIT:=INT(NUMBER/(BASE#^COUNT))
9060 NUMBER:=NUMBER-DIGIT*BASE#^COUNT
9070 IF DIGIT<10 THEN
9080 RES$:+CHR$(DIGIT+ORD("0"))
9090 ELSE
9100 RES$:+CHR$(DIGIT-10+ORD("┴"))
9110 ENDIF
9120 ENDFOR COUNT
9130 ELSE
9140 RES$:="0"
9150 ENDIF
9160 ENDPROC CONVERT